#include "pch.h"
#include <vector>
#include <math.h>
using namespace std;
#include "RasterIO.h"
#include "MatrixSF.h"
#pragma once
#define PI 3.1415926535

class ExpectationMax
{
public:
	BOOL Malloc_pLData(CString TifInPath);
	BOOL Malloc_MeanValueMat(int iClass, int iBandNum);
	BOOL Malloc_ConMat(int iClass, int iBandNum);
	BOOL Initialize();
	BOOL Result();
	BOOL ExpectationMaximization(double ** MeanValueMat, double *** ConMat_1, double * MatResult, double ** XMat, double ** XMatT, double * Rate, BYTE ** pCData, BOOL **pPData, int iHeightNum);
	RasterIO RasterR;
	unsigned short ** pLData;
	Matrix MatrixS;
	double ** MeanValueMatEM;
	double *** ConMatEM;
	double RateEM[5];
	double y[5];
	double m[5];
	BOOL Release();
};